<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>switch选择语句</title>
    <script>
        var day = new Date().getDay();
        switch (day) {
            case 0:
                x = "今天是周日"
                break;
            case 1:
                x = "今天是周一"
                break;
            case 2:
                x = "今天是周二"
                break;
            case 3:
                x = "今天是周三"
                break;
            case 4:
                x = "今天是周四"
                break;
            case 5:
                x = "今天是周五"
                break;
            case 6:
                x = "今天是周六"
                break;
        }
        document.write(x)
    </script>
</head>

<body>

</body>

</html>